﻿"use strict";

angular.module('ecApp').controller('ecAppController', ['$scope', '$localStorage', function ($scope, $localStorage) {

    $scope.state = $localStorage.logOnState || 'unauthorized';

    $scope.signIn = function () {
        $localStorage.logOnState = 'authorized';
        $scope.state = 'authorized';
    }

    $scope.userDetails = {
        Name: 'Sagar Shelar',
        ImageUrl: '../dist/img/user2-160x160.jpg'
    };

    $scope.notifications = [
        {
            Class: 'messages-menu',
            Icon: 'fa fa-envelope-o',
            Badge: {
                Label: 4,
                Icon: 'label label-success'
            },
            Header: 'You have 4 messages',
            Footer: 'See All Messages',
            Items: [
                {
                    Type: 'Avatar',
                    ImageUrl: '../dist/img/user2-160x160.jpg',
                    Title: 'Support Team',
                    Time: '5 mins',
                    Message: 'Why not buy a new awesome theme?'
                },
                {
                    Type: 'Avatar',
                    ImageUrl: '../dist/img/user3-128x128.jpg',
                    Title: 'AdminLTE Design Team',
                    Time: '2 hours',
                    Message: 'Why not buy a new awesome theme?'
                },
                {
                    Type: 'Avatar',
                    ImageUrl: '../dist/img/user4-128x128.jpg',
                    Title: 'Developers',
                    Time: 'Today',
                    Message: 'Why not buy a new awesome theme?'
                },
                {
                    Type: 'Avatar',
                    ImageUrl: '../dist/img/user3-128x128.jpg',
                    Title: 'Sales Department',
                    Time: 'Yesterday',
                    Message: 'Why not buy a new awesome theme?'
                },
                {
                    Type: 'Avatar',
                    ImageUrl: '../dist/img/user4-128x128.jpg',
                    Title: 'Reviewers',
                    Time: '2 days',
                    Message: 'Why not buy a new awesome theme?'
                }
            ]
        },
        {
            Class: 'notifications-menu',
            Icon: 'fa fa-bell-o',
            Badge: {
                Label: 10,
                Icon: 'label label-warning'
            },
            Header: 'You have 10 notifications',
            Footer: 'View all',
            Items: [
                {
                    Type: 'Alert',
                    Icon: 'fa fa-users text-aqua',
                    Message: '5 new members joined today'
                },
                {
                    Type: 'Alert',
                    Icon: 'fa fa-warning text-yellow',
                    Message: 'Very long description here that may not fit into the page and may cause design problems'
                },
                {
                    Type: 'Alert',
                    Icon: 'fa fa-users text-red',
                    Message: '5 new members joined'
                },
                {
                    Type: 'Alert',
                    Icon: 'fa fa-shopping-cart text-green',
                    Message: '25 sales made'
                },
                {
                    Type: 'Alert',
                    Icon: 'fa fa-user text-red',
                    Message: 'You changed your username'
                }
            ]
        },
        {
            Class: 'tasks-menu',
            Icon: 'fa fa-flag-o',
            Badge: {
                Label: 9,
                Icon: 'label label-danger'
            },
            Header: 'You have 9 tasks',
            Footer: 'View all tasks',
            Items: [
                {
                    Type: 'Progress',
                    Icon: 'progress-bar progress-bar-aqua',
                    Percent: '20',
                    Message: 'Design some buttons'
                },
                {
                    Type: 'Progress',
                    Icon: 'progress-bar progress-bar-green',
                    Percent: '40',
                    Message: 'Create a nice theme'
                },
                {
                    Type: 'Progress',
                    Icon: 'progress-bar progress-bar-aqua',
                    Percent: '60',
                    Message: 'Some task I need to do'
                },
                {
                    Type: 'Progress',
                    Icon: 'progress-bar progress-bar-yellow',
                    Percent: '80',
                    Message: 'Make beautiful transitions'
                }
            ]
        }
    ];
}]);